Report Paragraph

Report Paragraph assesslet and report

There are three different ways to add a new paragraph to the report.

A) Specify only a string when using add(). This string is printed directly into the report:

TPTReport.add("some information added in the current position")

B) Add the paragraph to a specified section:

TPTReport.add("section_ID","some information added to the specified section")

You can set the ID of a section you created in a script yourself by using section.setID("myID"). If you want to get the ID of a different report section, use the method TPTReport.getSectionByTitle(<Section name>).getID().

C) Create a report node and then either add it directly to the report or to a specific section. The following example produces the same output as the first example.

TPTReport.add(TPTReport.Paragraph("some information added in the current position")).

It is also possible to add style elements to the paragraph. In this case another report node needs to be used, the StyledParagraph(). With this report node you can use HTML syntax to format the text.

TPTReport.add(TPTReport.StyledParagraph(
"""<b>bold</b> or\n
<i>italic</i> or\n
<u>underline</u> or\n
<code>code</code> or\n
<font color='#FF0040'>colored text</font> or\n
<a href='http://www.piketec.com'>Link to Website</a>
"""));

This script will produce the following outcome:

To set up the report paragraph using a graphical user interface, see Assesslets - Report Paragraph.